#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/5/12 17:17
# @Author : 吴敬超
# explain:
import pandas as pd
import numpy as np

# 任意的多组列表
a = [1, 2, 3]
b = [4, 5, 6]
cla = "ac"
clb = "bc"
cld = "cc"

# 字典中的key值即为csv中列名
# dataframe = pd.DataFrame()

# dataframe['hhaa'] = 'dddd'

dataframe = pd.DataFrame({cld: "mmmm", cla: a, clb: b})
# dataframe['company'] = 'google'
# 将DataFrame存储为csv,index表示是否显示行名，default=True

# dataframe.to_csv("test.csv", header=False, index=False, sep=',')

# 生成的csv字段会根据字典排序，通过指定columns确定顺序 ,mode="a" 追加，line_terminator = '\n' 换行
dataframe.to_csv("test.csv", columns=[cld, cla, clb], header=False, index=False, sep=',',mode="a", line_terminator = '\n')
